package com.wang.模式.创建.单例;

/**
 * @author wang
 * @Description
 * @create 2021-10-12 16:25
 */
public class SingletonTest01 {
    public static void main(String[] args) {
        Singleton1 instance = Singleton1.getInstance();
        Singleton1 instance1 = Singleton1.getInstance();
        System.out.println(instance);
        System.out.println(instance1);
    }
}
class Singleton1{
    private Singleton1() {
    }
    public static final Singleton1 INSTANCE = new Singleton1();
    public static Singleton1 getInstance(){
        return INSTANCE;
    }
}
